﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="UFTNew.aspx.cs" Inherits="UFTNew"
    MasterPageFile="~/Default.master" EnableViewState="false" %>

<%@ Register Assembly="DevExpress.Web.ASPxEditors.v9.2, Version=9.2.9.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxEditors" TagPrefix="dxe" %>

<%@ Register Assembly="DevExpress.Web.ASPxGridView.v9.2, Version=9.2.9.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxGridView" TagPrefix="dxwgv" %>

<%@ Register Assembly="DevExpress.Web.v9.2, Version=9.2.9.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxCallback" TagPrefix="dxcb" %>
<%@ Register Assembly="DevExpress.Web.v9.2, Version=9.2.9.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxCallbackPanel" TagPrefix="dxcp" %>
<%@ Register Assembly="DevExpress.Web.v9.2, Version=9.2.9.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxPanel" TagPrefix="dxp" %>
<asp:Content ContentPlaceHolderID="head" ID="hd" runat="server" EnableViewState="false">

    <script src="UFTNew.js" type="text/javascript"></script>
<script src="js/Datetimepicker.js" type="text/javascript"></script>
    <script src="js/Ajax.js" type="text/javascript"></script>
    <script src="js/FileUpload.js" type="text/javascript"></script>
<script src="js/LOV.js" type="text/javascript"></script>
    <%--

    
    <!-- TinyMCE -->

    <script src="js/tiny_mce.js" type="text/javascript"></script>

    <!-- /TinyMCE -->--%>
    <link href="UFTNew.css" rel="stylesheet" type="text/css" />
</asp:Content>
<asp:Content ContentPlaceHolderID="leftMenu" ID="leftnav" runat="server" EnableViewState="false">
<% Response.Write(GenerateSideMenu()); %>

</asp:Content>
<asp:Content ContentPlaceHolderID="content" ID="ctnRelationship" runat="server" EnableViewState="false">
    <div id="pnlUFTNewTitle"></div>
    <div id="pnlUFTNew" runat="server"></div>
    <fieldset class="m_fs_border" id="fs_UFTNew">
        <legend>
            <a class="lnk" href="javascript:toggle('UFTNew');">
            <%if (m_bCheckClose)
              {
                  %>Event Details (This Event has been CLOSED)<%
              }
              else if (m_bSubmitted)
              {
                  %>Event Details<%
              }
              else
              {
                  %>Create New Event<%
              }                      
                                     
              %>
                </a>
        </legend>
        <dl class="m_fs">
            <div id="div_UFTNew">
            <% 
            if (m_iEventId > 0)
            {
                Response.Write(m_uftData.BuildFieldSet_UFTData());
                if (m_bCheckClose)
                {%>
                 <br />
                    <dxwgv:ASPxGridView ID="dgList" KeyFieldName="CUSTOMER_ID" 
                    ClientInstanceName="dgList_c" runat="server"
                    AutoGenerateColumns="true" Width="100%" Font-Size="Small">
                    <Styles Cell-HorizontalAlign="Left" Header-HorizontalAlign="Center" AlternatingRow-Enabled="True" Cell-Wrap="true" Cell-Font-Size="Smaller" Header-Wrap="true" Header-Font-Size="Smaller" Header-Font-Bold="true">
                    <Header Wrap="True" Font-Size="Smaller" Font-Bold="True"></Header>
                    <AlternatingRow Enabled="True"></AlternatingRow>
                    <Cell Wrap="True" Font-Size="Smaller"></Cell>
                    </Styles>
                    <SettingsPager PageSize="10"></SettingsPager>
                    <Settings ShowFilterBar="Visible" ShowFilterRow="true" ShowFilterRowMenu="true" />
                    <SettingsBehavior AllowSort="true"/>
                    <Columns>
                    <dxwgv:GridViewDataTextColumn FieldName="CUSTOMER_ID" Name="CUSTOMER_ID" Caption="CUSTOMER ID" />
                    <dxwgv:GridViewDataTextColumn FieldName="COMPANY_NAME" Name="COMPANY_NAME" Caption="COMPANY NAME" >
                        <DataItemTemplate>
                        <%# GridColumnManager.GetCompanyLinkColumn(Eval("CUSTOMER_ID").ToString(), Eval("COMPANY_NAME").ToString())%>
                        </DataItemTemplate>
                        <EditFormSettings Visible="False" />
                    </dxwgv:GridViewDataTextColumn>
                    <dxwgv:GridViewDataTextColumn FieldName="TOTAL_GUEST" Name="TOTAL_GUEST" Caption="TOTAL GUEST" />
                    <dxwgv:GridViewDataTextColumn FieldName="STATUS_HADIR" Name="STATUS_HADIR" Caption="STATUS HADIR" />
                    </Columns>
                    </dxwgv:ASPxGridView>
                <%}
            }
            else
            {
                Response.Write(m_uftData.BuildEditor_UFTData());
            } %>
            </div>
            <dxcb:ASPxCallback ID="cbkUFTNew" ClientInstanceName="cbkUFTNew_c" runat="server"
            OnCallback="cbkUFTNew_Callback">
            <ClientSideEvents CallbackComplete="function(s, e) { cbkUFTNew_c_CallbackComplete(e); }" CallbackError="function(s, e) { cbkUFTNew_c_CallbackError(e); }"/>
            </dxcb:ASPxCallback>
            <% if (m_iEventId < 1){ %>
            <input type="button" id="lnkfltr_UFTNew" class="btn" style="float: right; margin-left: 5px;"
            onclick="UFTNew_Create();" value="create" />
            <%}%>
        <div id="load_UFTNew" style="float: right; padding-right: 10px;">
        </div>
        </dl>
    </fieldset>
    <% if (m_iEventId > 0 && !m_bCheckClose)
       {%>
    <fieldset class="m_fs_border" id="fs_Invitation">
        <legend>
            <a class="lnk" href="javascript:toggle('Invitation');">
                Select Customer to Invite</a>
        </legend>
        <dl class="m_fs">
        
        <dxcb:ASPxCallback ID="cbkInvitation" ClientInstanceName="cbkInvitation_c" runat="server"
            OnCallback="cbkInvitation_Callback">
            <ClientSideEvents CallbackComplete="function(s, e) { cbkInvitation_c_CallbackComplete(e); }" CallbackError="function(s, e) { cbkInvitation_c_CallbackError(e); }"/>
        </dxcb:ASPxCallback>
        <%if (!m_bSubmitted)
          {
              Response.Write(UFTManager.BuildUFTCustomer_Filter());
          } %>
        <div id="div_Invitation" style="display:block; overflow:visible;">
        <% if (!m_bSubmitted)
           {
            %>
                    <div id="lnkCheckAll" class="lnk" onclick="checkAll();" style="float:left;margin-left: 5px;">check</div>
                        &nbsp;
                    <div id="lnkUncheckAll" class="lnk" onclick="uncheckAll();" style="float:left;margin-left: 5px;">uncheck</div>
                    <dxwgv:ASPxGridView ID="dgCustomerList" KeyFieldName="CUSTOMER_ID" 
                    ClientInstanceName="dgGuest_Invitation_c" runat="server"
                    AutoGenerateColumns="true" Width="100%" Font-Size="Small" 
                        OnCustomCallback="dgGuest_Invitation_CustomCallback">
                    <Styles AlternatingRow-Enabled="True" Cell-Wrap="true" Cell-Font-Size="Smaller" Header-Wrap="true" Header-Font-Size="Smaller" Header-Font-Bold="true">
                    <Header Wrap="True" Font-Size="Smaller" Font-Bold="True"></Header>
                    <AlternatingRow Enabled="True"></AlternatingRow>
                    <Cell Wrap="True" Font-Size="Smaller"></Cell>
                        </Styles>
                    <SettingsPager PageSize="50"></SettingsPager>
                    <Settings ShowFilterBar="Visible" ShowFilterRow="true" ShowFilterRowMenu="true" ShowHorizontalScrollBar="true"  />
                    <SettingsBehavior AllowSort="true"/>
                    <%--<Columns>
                        <dxwgv:GridViewDataTextColumn FieldName="COMPANY_NAME" Name="COMPANY_NAME" Caption="COMPANY NAME" >
                        <DataItemTemplate>
                        <%# GridColumnManager.GetCompanyLinkColumn(Eval("CUSTOMER_ID").ToString(), Eval("COMPANY_NAME").ToString())%>
                        </DataItemTemplate>
                        <EditFormSettings Visible="False" />
                    </dxwgv:GridViewDataTextColumn>
                    </Columns>--%>
                    <ClientSideEvents EndCallback="dgGuest_Invitation_c_EndCallBack" />
                    </dxwgv:ASPxGridView>
                    <br />
                    <input type="button" id="btnSelect" class="btn" onclick="DoSelect();" value="Move Selected &darr;&darr;"/>
                    <input type="hidden" id="hfSelect"/>
                    <br />
                    <br />
                    <%} %>
                    <p>SELECTED COMPANY</p>
                    <dxwgv:ASPxGridView ID="dgSelected" ClientInstanceName="dgSelected_Invitation_c"
                        AutoGenerateColumns="true" Width="100%" runat="server" Font-Size="Small" 
                        OnCustomCallback="dgSelected_Invitation_CustomCallback" >
                        <Styles AlternatingRow-Enabled="True" Cell-Wrap="True" Cell-Font-Size="Smaller"  Header-Wrap="true" Header-Font-Size="Smaller" Header-Font-Bold="true">
                        <Header Wrap="True" Font-Size="Smaller" Font-Bold="True"></Header>
                        <AlternatingRow Enabled="True"></AlternatingRow>
                        <Cell Wrap="True" Font-Size="Smaller"></Cell>
                        </Styles>
                        <SettingsPager PageSize="10"></SettingsPager>
                        <Settings ShowFilterBar="Visible"  ShowHorizontalScrollBar="true"  />
                        <SettingsBehavior AllowSort="true"/>
                    </dxwgv:ASPxGridView>
        <% if (!m_bSubmitted && (ICPUser.IsAdmin || ICPUser.IsAdminForum)){%>
                    <br/>
                    <input type="button" id="btnSubmit" class="btn" style="float: left; margin-left: 5px;"
                    onclick="DoSubmit();" value="Submit" />
                    <div id="loadSubmit" style="float: left; padding-right: 10px;">
                    </div>
        <%}%>
        </div>
        
        </dl>
    </fieldset>
    <% } %>
</asp:Content>
